<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright 2009 XBRL International. All Rights Reserved. -->
<?xml-stylesheet type="text/xsl" href="../stylesheets/conformanceFunction.xsl"?>
<testcase
  xmlns="http://xbrl.org/2008/conformance"
  xmlns:reg="http://xbrl.org/2008/registry"
  xmlns:fcn="http://xbrl.org/2008/function"
  xmlns:cfcn="http://xbrl.org/2008/conformance/function"
  xmlns:xbrli="http://www.xbrl.org/2003/instance"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xff="http://www.xbrl.org/2010/function/formula"
  xmlns:xffe="http://www.xbrl.org/2010/function/formula/error"
  xmlns:xqt-err="http://www.w3.org/2005/xqt-errors"
  xmlns:concept="http://xbrl.org/formula/conformance/example" 
  xmlns:xlink="http://www.w3.org/1999/xlink"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:xs="http://www.w3.org/2001/XMLSchema"
  xsi:schemaLocation="
  http://xbrl.org/2008/registry ../schemas/registry.xsd
  http://xbrl.org/2008/function ../schemas/function.xsd
  http://xbrl.org/2008/conformance ../schemas/conformance.xsd
  http://xbrl.org/2008/conformance/function ../schemas/conformanceFunction.xsd
  ">
  <owners>
    <reg:owner id="herm">
      <reg:name>Herm Fischer</reg:name>
      <reg:affiliation>Mark V Systems (Formerly UBmatrix)</reg:affiliation>
      <reg:email>fischer@markv.com</reg:email>
     <reg:assumedOwnership moment="2011-07-08T22:00:00" />
    </reg:owner>
  </owners>

  <number>80156</number>

  <name>Function test xff.has-fallback-value</name>

  <documentation>
    <xhtml:p>
      Tests of xff.has-fallback-value($variable as xs:QName) as xs:boolean
      </xhtml:p>
    <xhtml:p>
      The xff.has-fallback-value function can only usefully be applied to bound variables in a precondition, 
      consistency assertion, formula, and message processing.  Because the function testcase does 
      not have any way to set up and execute variable sets, it cannot test this function with a factVariable.
      </xhtml:p>
      <xhtml:p>
      There is a formula test case provided in this directory for that purpose,
      and it is listed as a testcase in the trunk/index.xml testcases file, to cause its execution.
      </xhtml:p>
  </documentation>

  <reference xlink:type="simple" xlink:href="http://xbrl.org/Specification/variables/REC-2009-06-22/variables-REC-2009-06-22+corrected-errata-2011-03-16.html#term-fallback-value"/>

  <variation id="V-01">
    <name>Function raises an exception when not used in a precondition, message, consistency/value assertion or formula result or aspect rule expression.</name>
    <documentation>
      <xhtml:p>
      </xhtml:p>
    </documentation>

    <inputs>
      <instance readMeFirst="true" id="V01" xlink:type="simple" xlink:href="nihil.xml"/>
      <cfcn:call file="V01">
         for $foo in ('abc') return xff:has-fallback-value( QName('','foo' ) )
      </cfcn:call>
    </inputs>
    <outputs>
      <error>xffe:invalidFunctionUse</error>
    </outputs>
  </variation>

  <variation id="V-02">
    <name>Argument is not a QName</name>
    <documentation>
      <xhtml:p>
        XPath-defined error for type of argument.
      </xhtml:p>
    </documentation>
    <inputs>
      <schema xlink:type="simple" xlink:href="uncovered-aspect-tests.xsd"/>
      <instance readMeFirst="true" id="V02" xlink:type="simple" xlink:href="nihil.xml"/>
      <cfcn:call file="V02">
         xff:has-fallback-value( 'hello I am not a QName' )
      </cfcn:call>
    </inputs>
    <outputs>
      <error>xqt-err:XPTY0004</error>
    </outputs>
  </variation>

  <revisions>
    <reg:revision on="2011-07-08T22:00:00" by="herm">
      <xhtml:p>
        Created the test case.
      </xhtml:p>
    </reg:revision>
  </revisions>

</testcase>
